home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / QuickDraw / TE Over Background / TESampleGlue.a < prev    next >
Encoding:
Text File  |  1994-11-09  |  2.5 KB  |  77 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TESample
  7. ;
  8. ;    TESampleGlue.a    -    Assembler Source
  9. ;
  10. ;    Copyright © 1989 Apple Computer, Inc.
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    
  14. ;                1.00                08/88
  15. ;                1.01                11/88
  16. ;                1.02                04/89
  17. ;                1.03                06/89
  18. ;
  19. ;
  20. ;    TESample is an example application that demonstrates how 
  21. ;    to initialize the commonly used toolbox managers, operate 
  22. ;    successfully under MultiFinder, handle desk accessories and 
  23. ;    create, grow, and zoom windows. The fundamental TextEdit 
  24. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  25. ;    also shows how to create and maintain scrollbar controls.
  26. ;
  27. ;    It does not by any means demonstrate all the techniques you 
  28. ;    need for a large application. In particular, Sample does not 
  29. ;    cover exception handling, multiple windows/documents, 
  30. ;    sophisticated memory management, printing, or undo. All of 
  31. ;    these are vital parts of a normal full-sized application.
  32. ;
  33. ;    This application is an example of the form of a Macintosh 
  34. ;    application; it is NOT a template. It is NOT intended to be 
  35. ;    used as a foundation for the next world-class, best-selling, 
  36. ;    600K application. A stick figure drawing of the human body may 
  37. ;    be a good example of the form for a painting, but that does not 
  38. ;    mean it should be used as the basis for the next Mona Lisa.
  39. ;
  40. ;    We recommend that you review this program or Sample before 
  41. ;    beginning a new application. Sample is a simple app. which doesn’t 
  42. ;    use TextEdit or the Control Manager.
  43. ;
  44.  
  45. ;
  46. ;    AsmClickLoopProc
  47. ;
  48. ;    This routine gets called by the TextEdit Manager from TEClick.
  49. ;    It calls the old, default click loop routine that scrolls the
  50. ;    text, and then calls our own Pascal routine that handles
  51. ;    tracking the scroll bars to follow along.  It doesn't bother
  52. ;    with saving registers A0 and D0, because they are trashed
  53. ;    anyway by TextEdit.
  54. ;
  55.  
  56. AsmClickLoopProc    PROC        EXPORT
  57.  
  58.             IMPORT        GETOLDCLICKLOOP
  59.             IMPORT        CLICKLOOPADDON
  60.             
  61.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  62.             CLR.L        -(SP)                ; make space for procedure pointer
  63.             JSR            GETOLDCLICKLOOP        ; get the old clikLoop
  64.             MOVEA.L        (SP)+,A0            ; into A0
  65.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  66.             
  67.             JSR            (A0)                ; and execute old clikLoop
  68.  
  69.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  70.             JSR            CLICKLOOPADDON        ; do our clikLoop
  71.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  72.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  73.             RTS
  74.  
  75.             END 
  76.  
  77.